package Thread;

import java.util.Random;

public class ThreadExam {
	public static int num = 0;
	public static void main(String[] args) {
		new Number().start();
		new sharp().start();
	}

}
class Number extends Thread{
	@Override
	public void run(){
		for(int i = 1 ; i <= 100 ; i++){
			ThreadExam.num = i;
			System.out.print(i);
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}

class sharp extends Thread{
	Random random = new Random();
	
	@Override
	public void run() {
		while(true){
			if(	ThreadExam.num > 99) break;
			System.err.print("#");
			try {
				Thread.sleep((random.nextInt(91)+10));
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
		}
	} 
}